GBML manual / Rooms

room_forget

Makes the game forget room r if it was keeping it, so the next time the player goes there it is built new from what you placed in it.

Syntax

room_forget(r)

Arguments

NameType
rroom

Returns

Nothing.

Description

Makes the game forget room r, if it was keeping it. A room marked Persistent is kept when you leave it, with every object in it just as you left it (see Persistent rooms). After room_forget, the next time the player goes to r the room is built new from what you placed in it, as if nobody had ever been there.

The objects of the forgotten room get their Cleanup event, as if they had been taken away. They do not get Destroy: nothing destroyed them, the room was given up.

It does nothing when there is nothing to forget: the player has never been in r, r is not Persistent, it was forgotten already, or it is the room the player is in right now. The room you are in is not kept, it is the live one. To build that room again, use room_restart.

It works at once, in the middle of whatever event called it.

Example

room_forget(room_doc_arena);

The game gives up room_doc_arena if it was keeping it. Whoever walks into the arena next finds it as it was first built.

On the GBA

Only a room marked Persistent is ever kept (see the Persistent rooms page). The objects of the forgotten room get their Cleanup event, as if they were taken away, and are gone for good. This does nothing when r is not being kept: the player has never been there, it is not Persistent, it was forgotten already, or it is the room the player is in right now (that room is not set aside, it is the live one - use room_restart to build it again). It happens at once, in the middle of whatever event called it.

See also: room_forget_allroom_restartroom_change